package cn.edu.wynu.var;

/**
 * 课本28页上机练习题2
 */
public class Rectangle02 {
    public static void main(String[] args) {
        // 矩形长和宽分别是5和4. 求:①周长 ②面积
        int a = 4, b = 5;

        // ① 求周长C = (a + b) * 2
        int c = (a + b) * 2;

        // ②求面积S = a * b
        int s = a * b;

        System.out.println("周长:" + c);
        System.out.println("面积:" + s);
    }
}
